<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE html>
<html lang="zh-CN" class="ua-windows ua-webkit">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<title>发表你的看法</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="<s:url value="/css/base.css"/>"></link>
<script src="../js/jquery-1.7.2.min.js" type="text/javascript"></script>
<!-- 验证控件 -->
<script src="../js/formValidator/formValidator-4.1.1.js" type="text/javascript" charset="UTF-8"></script>
<script src="../js/formValidator/formValidatorRegex.js" type="text/javascript" charset="UTF-8"></script>
<!-- 文本编辑器 -->
<link rel="stylesheet" href="../js/kindeditor/plugins/code/prettify.css" />
<script charset="utf-8" src="../js/kindeditor/plugins/code/prettify.js"></script>
<script type="text/javascript" src="../js/kindeditor/kindeditor-min.js" ></script>
<script type="text/javascript" src="../js/kindeditor/zh_CN.js" ></script>
<!-- date picker 日期控件 -->
<link rel="stylesheet" href="../js/datepicker/datepicker.css" />
<script  type="text/javascript" src="../js/datepicker/bootstrap-datepicker.js"></script>
<script type="text/javascript">
var editor;
KindEditor.ready(function(K) {
	editor = K.create('textarea[name="article.content"]', {
		cssPath : '../js/kindeditor/plugins/code/prettify.css',
		allowFileManager : true,
		width : '470px',
		height : '200px',
		uploadJson : '../kindeditor/upload',
		fileManagerJson : '../kindeditor/manager',
		allowFileManager : true,
		items : [ 'bold', 'italic', 'underline', 'strikethrough', 'removeformat','|','forecolor', 'hilitecolor',  
					 'title', 'fontname', 'fontsize',  '|', 
					 'justifyleft', 'justifycenter', 'justifyright','|', 
					  'emoticons', 'image'
					 ]
	});
	//prettyPrint();
});

$(document).ready(function(){
	$.formValidator.initConfig({formID:"form1",theme:"Default",debug:false,submitOnce:true,
		onError:function(msg,obj,errorlist){
			$("#errorlist").empty();
			$.map(errorlist,function(msg){
				$("#errorlist").append("<li>" + msg + "</li>")
			});
			alert(msg);
		},
		submitAfterAjaxPrompt : '有数据正在异步验证，请稍等...',
		onShowClass : "",
		onFocusClass : "",
		onCorrectClass : ""
	});
	
	$("#title").formValidator(
			{
			onShow:"为你今天的心得起一个响亮的名字吧!",
			onFocus:"为你今天的心得起一个响亮的名字吧!"})
		.inputValidator({
			min:1,
			max:100,
			onError:"请输入标题!"
			});
	
	
	$("#artContent").formValidator(
			{
			onShow:"分享下你今天的心得吧！",
			onFocus:"分享下你今天的心得吧！"})
		.inputValidator({
			max:5000,
			onError:"心得内容要在10个字以上哦!"
			});
	
});


</script>
</head>

<body>
	<%@include file="/top.jsp"%>

<div id="wrapper">
		<div id="header">
			<div class="site-nav single-nav">
				<div class="site-nav-logo">
				</div>
			</div>
		</div>
		<div id="content">

			<h1>期待你的分享 ~ ^_^</h1>
			<div class="grid-16-8 clearfix">
				<div class="article">
					
					<form name="form1" id="form1" action="write.action?op=save" method="post">
						
						<div class="item extra-tips">
							<label>主题</label>
							<input type="text" id="title" maxlength="100" style="width:450px;" name="article.title" />
						</div>
						<div class="suggestion" >
							<span id="titleTip"></span>
						</div>
						
						<div class="item extra-tips">
							<label>内容</label>
							<textarea id="artContent" name="article.content" ></textarea>
						</div>
						<div class="suggestion" >
							<span id="artContentTip"></span>
						</div>						
						
						<div class="item-submit">
							<label>&nbsp;</label> 
							<br/>
							<input type="submit" class="btn-submit" value="分享亮光!" />
						</div>
					</form>
				</div>
				
				<div class="aside">
					
					<p class="p1">
						&gt;&nbsp;请不要写违法内容，维护好网站的环境! 
						<!-- 
						<a rel="nofollow" href="<s:url value="/article/write.action" />">我要分享!!!~~^_^</a>
						 -->
					</p>
					
				</div>
				<div class="extra">
				</div>
			</div>
		</div>


		<%@include file="/footer.jsp"%>
	</div>
 
</body>
</html>

